﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MaterialStorage.Model
{
    public class Users
    {
        public int Id { get; set; }

        public string Username { get; set; }

        public string Password { get; set; }

        public Users()
        {
            this.Id = int.MinValue;
        }

        public Users GetUser(DavidDB.ADO.DBManager db, string username, string password)
        {
            Users u = new Users();
            u.Username = username;
            u.Password = password;
            var query = db.GetSomeObject(u).ToList();
            if (query.Count() > 0)
            {
                return query.FirstOrDefault();
               
            }
            else
            {
                return null;
            }
        }
    }
}
